class My implements Runnable{

    public void run(){
        System.out.println(Thread.currentThread().getName());
    }

}

public class SetPriority{

    public static void main(String[] args){

        My m = new My();
        Thread t1 = new Thread(m, "Thread 01");
        Thread t2 = new Thread(m, "Thread 02");
        Thread t3 = new Thread(m, "Thread 03");

        // set priority
        t1.setPriority(2);
        t2.setPriority(8);
        t3.setPriority(6);

        t1.start();
        t2.start();
        t3.start();

    }

}